
declare -r TypeAgeEthMac="AGE_ETH_MAC"
declare -r TypeAgeTimesHours="TIMES_HOURS"

declare -rx AGING_WORK_PWD=$(pwd)
#declare -rx AGING_WORK_PWD=$(dirname $(pwd))
#declare -rx AGING_TEST_PWD=${AGING_WORK_PWD}/aging_test
declare -rx AGING_TEST_PWD=${AGING_WORK_PWD}

declare -rx json_func_file=${AGING_TEST_PWD}/json_func_file.json
declare -rx txt_func_additem=${AGING_TEST_PWD}/json_func_additm.txt

function aging_json_add_item()
{

    declare POS=$1
    declare KEY=$2
    declare VALUE=$3


    if [ ! -f ${json_func_file} ]; then
        echo '{}' > ${json_func_file}

        echo "TEST_MAC_CUR:0002"
    else
        #echo `ifconfig|grep "1c:83:41"|awk '{print $5}'`
        echo "TEST_MAC_CUR:0003"
    fi

    if jq "$POS += {$KEY: $VALUE }" "${json_func_file}" > ${txt_func_additem} ; then
        sudo mv -f ${txt_func_additem} "${json_func_file}"
        return 0
    else
        return 1
    fi

    return 1
}

declare strEthMAc="strIfcfgMac"

strEthMAc="\"${strEthMAc}\""
echo "init_aging_cfg 01 \${strEthMAc}=${strEthMAc}"

echo "json_func_file 01 \${strEthMAc}=${json_func_file}"


aging_json_add_item . ${TypeAgeEthMac} "${strEthMAc}"
aging_json_add_item . ${TypeAgeTimesHours} "97"